home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / dungeon / sysvr3 / SysVR3.pch
Encoding:
Text File  |  1988-11-08  |  25.5 KB  |  955 lines

  1. *** README.rjnoe.orig    Fri Oct 28 11:36:38 1988
  2. --- README.rjnoe    Fri Oct 28 11:36:38 1988
  3. ***************
  4. *** 0
  5.  
  6. --- 1,144 -----
  7. + I have attempted porting the UNIX F77 version of Dungeon - which you posted
  8. + to Usenet about a year ago - to the AT&T 3B2/400 running UNIX System V
  9. + Release 3.0.  What follows is a description of some of the things I needed
  10. + to change just to get it running on my system.  I hope you find it useful.
  11. + The base patch level I worked from was 3 (including the "3.1" patch).
  12. + 1. Different F77 Compilation System
  13. + First off, this UNIX system does not use the FORTRAN 77 compiler and
  14. + archive libraries used on previous versions of System V.  What I have is
  15. + called FORTRAN 77 XLA+ Compilation System, Issue 1 Version 0.  The F77
  16. + used on previous UNIX machines is sometimes called f77 1.1.  This difference
  17. + required several changes to Makefile.sysv.  Both the command to invoke
  18. + the compiler and options recognized by the compiler are different.
  19. + I have learned that there is a newer version of F77-XLA+ available from
  20. + AT&T; some of the problems I mention below might be fixed in that version.
  21. + 2. No LOGICAL Arguments to Bitwise Intrinsic Functions
  22. + The F77-XLA+ compiler is picky about LOGICAL type arguments being passed
  23. + to the intrinsic bitwise (INTEGER) functions and(), or(), and not().  This
  24. + was very easily fixed by translating to the logical operators .AND., .OR.,
  25. + and .NOT..
  26. + 3. No INTEGER Arguments to ichar() Intrinsic Function
  27. + The F77-XLA+ compiler is picky about INTEGER arguments passed to ichar().
  28. + They were redundant calls in all cases I found.  (Just the INW() and UINW()
  29. + arrays were involved.)
  30. + 4. No $ Edit Descriptor in FORMAT Statements
  31. + The F77-XLA+ compiler does not recognize the $ in FORMAT statements as a
  32. + means of suppressing newline at the end of an output operation.  This was
  33. + apparently not an oversight; they documented its absence.  I have found some
  34. + vestiges of the code which would have implemented it (e.g. an external symbol
  35. + in the I/O library called "F77nonl") but the capability is just not there.
  36. + I can find no substitute and have been putting up with having my ">" game
  37. + prompt not appear on the same line as my input.
  38. + 5. FUNCTION INIT() Name Conflict
  39. + The external symbol "init" is used in the F77-XLA+ I/O library libfortI77.a
  40. + to indicate whether or not it has been initialized in the current process.
  41. + I merely changed the Dungeon function name to DINIT.
  42. + 6. CLOSE() with Long Filename Causes Fatal Run-time Errors
  43. + There is a bug in the F77-XLA+ I/O library libfortI77.a that occurs when
  44. + trying to CLOSE() a unit that had been OPENed to a UNIX file with a long
  45. + pathname.  Think of the F77 I/O subsystem as overlying the standard I/O
  46. + (stdio) subsystem.  A F77 OPEN eventually calls fopen(3S) [3S: in the stdio
  47. + library] and stores the FILE * pointer which fopen returns into an element
  48. + of an array of structures corresponding to the unit number OPENed.  When
  49. + the unit is CLOSEd, the file name passed to OPEN is copied into a character
  50. + array within this same structure, using strcpy(3C) [3C: in the C library].
  51. + (I assume this is to allow future reOPENing of the file, but haven't really
  52. + looked into this much.)  No bounds or string length checking is done.  So
  53. + when the filename is long (as might be expected for INDXFILE or TEXTFILE),
  54. + this overwrites the next F77 I/O unit structure with garbage.  If the next
  55. + unit was being used, the pointer to the corresponding stdio structure is now
  56. + gone.  If not, the next unit now appears to be in use because the FILE *
  57. + is no longer a NULL pointer and when the F77 code exits normally (e.g.
  58. + through STOP) it will try to clean up this unit.  These considerations
  59. + led me to make the following changes:
  60. +     Since INDXFILE and TEXTFILE could not be CLOSEd once OPENed, I
  61. +     moved INDXFILE from unit 1 to unit 3.  Unit 1 is now used only
  62. +     for "dsave.dat", which is short enough that it can be closed and
  63. +     opened normally.  TEXTFILE remains at unit 2.
  64. +     I dropped my exit.F source file containing SUBROUTINE EXIT (which
  65. +     consisted entirely of one executable statement, STOP) and replaced
  66. +     it with exit.c containing the C function void exit_().  Since STOP
  67. +     tries to clean up F77 I/O unit structures that have been OPENed,
  68. +     I circumvent this by doing a CALL EXIT in F77 which invokes the
  69. +     C function exit_() on my system.  The latter function simply calls
  70. +     exit() in the C/stdio library, cleans up the stdio structures and
  71. +     terminates the process without mucking with the screwy F77 I/O
  72. +     subsystem.
  73. + 7. CHARACTER Arguments Passed Inconsistently
  74. + The F77-XLA+ documentation indicates that a CHARACTER variable (or an
  75. + array of CHARACTER variables) is not quite passed by reference.  Instead
  76. + of just passing the address of the variable (or base address of the array),
  77. + effectively what is passed is a pointer to a structure containing (in C):
  78. + struct { char *s; long l; } where s is the pointer to the CHARACTER variable
  79. + (or array) and l is its length.  So dereferencing the passed pointer once
  80. + will give you s, the address of the CHARACTER variable.  All fine and dandy,
  81. + but they DIDN'T TELL THE PEOPLE WHO CODED THE I/O LIBRARY!  When a CHARACTER
  82. + array is passed to READ(), it interprets the structure pointer passed as the
  83. + address of the variable and starts overwriting the wrong place.  The one place
  84. + I found this was in RDLINE() and I fixed it by changing the READ() BUFFER to
  85. + use an implied DO loop.  What can I say, at least it works.
  86. + 8. Large Amounts of I/O in One Statement Fail
  87. + There appears to be some not easily identifiable bug in the F77-XLA+ I/O
  88. + library which causes it to abort when writing large amounts of data in
  89. + one single WRITE().  I found this when attempting to save the game in
  90. + dsave.dat.  I separated the largest arrays (notably the COMMON /OBJCTS/
  91. + arrays) into individual WRITEs and haven't had any further problems.
  92. + I changed the READs (for game restoration) to be identical, just for
  93. + consistency's sake.
  94. + There are probably other bugs I have not yet discovered.  Already I am
  95. + suspicious of the random number generation on my system since I've never
  96. + had to take more than one whack at the troll before he's knocked out.
  97. + I'll keep looking at things like that and keep you posted, if you like.
  98. + There are also a few other things my compiler complains about that I did not
  99. + bother to fix:
  100. + The C preprocessor (/lib/cpp) in System V Release 3 warns about extra
  101. + tokens on cpp lines like #else, #elif, and #endif.  One way to suppress
  102. + these warnings is to add /* comment */ delimiters around the offending token:
  103. +     #ifdef PDP
  104. +     ...
  105. +     #else /* PDP */
  106. +     ...
  107. +     #endif /* PDP */
  108. + The F77-XLA+ compiler warns about a duplicate type statement for PRSWON in
  109. + FUNCTION BLOW in demons.F.  Since PRSWON is already declared in parser.h, it
  110. + need not be declared again in demons.F, as it #includes parser.h.
  111. + The F77-XLA+ compiler complains if the last statement before END in each
  112. + FUNCTION is not a RETURN.  Specifically, in the following:
  113. +         BALLOP in ballop.F
  114. +         DINIT in dinit.F
  115. +         LEX in np.F
  116. +         SPARSE in np1.F
  117. +         CYCLOP in villns.F
  118. + DINIT has FORMAT statements between RETURN and END, CYCLOP has a computed
  119. + GOTO just before the END, and the others all have unconditional GOTOs just
  120. + before their ENDs.  If you ask me, the F77-XLA+ compiler is being a little
  121. + weird here.
  122. + If there's anything I can do to help out with Dungeon, please let me know.
  123. + If no one else has done it, I'm toying with the idea of porting it to C.
  124. + Please let me know your opinion on that.  Thanks.
  125. + --
  126. +     Roger Noe            rjnoe@arrakis.ece.uiuc.edu
  127. +     University of Illinois
  128. +     Department of Electrical and Computer Engineering
  129. +     248 Everitt Laboratory
  130. +     1406 West Green Street
  131. +     Urbana, IL  61801  USA        40:06:39 N.  88:13:41 W.
  132. +     +1 217 333 3496
  133. *** Makefile.sysv.orig    Mon Oct 24 15:28:55 1988
  134. --- Makefile.sysv    Mon Oct 24 15:28:54 1988
  135. ***************
  136. *** 1,3
  137.   # Makefile for creating dungeon
  138.   # Edit BIN DDIR and FFLAGS suitable for your system
  139.   # Also, if you are running System V change the .F.o production
  140.  
  141. --- 1,4 -----
  142. + F77 = fort
  143.   # Makefile for creating dungeon
  144.   # Edit BIN DDIR and FFLAGS suitable for your system
  145.   # Also, if you are running System V change the .F.o production
  146. ***************
  147. *** 11,17
  148.   #    f77 -c $(FFLAGS) $*.F
  149.   # For System V use the following production instead:
  150.       @/lib/cpp $(CPPFLAGS) $*.F > $*.f
  151. !     f77 -c $(FFLAGS) $*.f
  152.       rm $*.f
  153.   
  154.   # define SYSV if running System V or V7
  155.  
  156. --- 12,18 -----
  157.   #    f77 -c $(FFLAGS) $*.F
  158.   # For System V use the following production instead:
  159.       @/lib/cpp $(CPPFLAGS) $*.F > $*.f
  160. !     $(F77) -c $(FFLAGS) $*.f
  161.       rm $*.f
  162.   
  163.   # define SYSV if running System V or V7
  164. ***************
  165. *** 24,30
  166.   #FOPTS = -q # -g -Ddebug
  167.   # use -Nn650 for System V to increase default symbol table size
  168.   # also, no -g flag (causes runtime errors)
  169. ! FOPTS = -q -Nn650
  170.   # f77 compiler flags for pdp (64K split I/D)
  171.   #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
  172.   FFLAGS = -O $(FOPTS)
  173.  
  174. --- 25,32 -----
  175.   #FOPTS = -q # -g -Ddebug
  176.   # use -Nn650 for System V to increase default symbol table size
  177.   # also, no -g flag (causes runtime errors)
  178. ! #FOPTS = -q -Nn650
  179. ! FOPTS = 
  180.   # f77 compiler flags for pdp (64K split I/D)
  181.   #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
  182.   FFLAGS = -O $(FOPTS)
  183. ***************
  184. *** 51,57
  185.   FSRC =  actors.F ballop.F clockr.F demons.F\
  186.       dgame.F dinit.F dmain.F dso1.F dso2.F\
  187.       dso3.F dso4.F dso5.F dso6.F dso7.F\
  188. !     dsub.F dverb1.F dverb2.F exit.F gdt.F lightp.F\
  189.       nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  190.       rooms.F sobjs.F sverbs.F verbs.F villns.F
  191.   
  192.  
  193. --- 53,59 -----
  194.   FSRC =  actors.F ballop.F clockr.F demons.F\
  195.       dgame.F dinit.F dmain.F dso1.F dso2.F\
  196.       dso3.F dso4.F dso5.F dso6.F dso7.F\
  197. !     dsub.F dverb1.F dverb2.F gdt.F lightp.F\
  198.       nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  199.       rooms.F sobjs.F sverbs.F verbs.F villns.F
  200.   
  201. ***************
  202. *** 55,61
  203.       nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  204.       rooms.F sobjs.F sverbs.F verbs.F villns.F
  205.   
  206. ! CSRC =    cinit.c cio.c cspeak.c decode.c lex.c listen.c rtim.c
  207.   
  208.   OBJS =  actors.o ballop.o clockr.o demons.o\
  209.       dgame.o dinit.o dmain.o dso1.o dso2.o\
  210.  
  211. --- 57,63 -----
  212.       nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
  213.       rooms.F sobjs.F sverbs.F verbs.F villns.F
  214.   
  215. ! CSRC =    cinit.c cio.c cspeak.c decode.c exit.c lex.c listen.c rtim.c
  216.   
  217.   OBJS =  actors.o ballop.o clockr.o demons.o\
  218.       dgame.o dinit.o dmain.o dso1.o dso2.o\
  219. ***************
  220. *** 72,78
  221.   pdp:    dungpdp speak listen dtext.dat
  222.   
  223.   dungeon: $(OBJS)
  224. !     f77 -o dungeon $(OBJS) $(LDFLAGS)
  225.       @echo done
  226.   
  227.   dungpdp: $(OBJS) $(PDPOBJS)
  228.  
  229. --- 74,80 -----
  230.   pdp:    dungpdp speak listen dtext.dat
  231.   
  232.   dungeon: $(OBJS)
  233. !     $(F77) -o dungeon $(OBJS) $(LDFLAGS)
  234.       @echo done
  235.   
  236.   dungpdp: $(OBJS) $(PDPOBJS)
  237. ***************
  238. *** 98,105
  239.   dinit.o: dinit.F
  240.   #    f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
  241.   # For System V use the following instead:
  242. !     @/lib/cpp $(CPPFLAGS) dinit.F > dinit.f
  243. !     f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.f
  244.       rm $*.f
  245.   
  246.   # uncomment the following for Suns to get around an optimizer bug
  247.  
  248. --- 100,107 -----
  249.   dinit.o: dinit.F
  250.   #    f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
  251.   # For System V use the following instead:
  252. !     @/lib/cpp $(CPPFLAGS) -DDDIR=$(DDIR) $(WIZDEF) dinit.F > dinit.f
  253. !     $(F77) -c $(FFLAGS) dinit.f
  254.       rm $*.f
  255.   
  256.   # uncomment the following for Suns to get around an optimizer bug
  257. *** dinit.F.orig    Mon Oct 24 15:28:55 1988
  258. --- dinit.F    Mon Oct 24 15:28:55 1988
  259. ***************
  260. *** 18,24
  261.   C
  262.   C DECLARATIONS
  263.   C
  264. !     LOGICAL FUNCTION INIT(X)
  265.       IMPLICIT INTEGER (A-Z)
  266.   #ifndef PDP
  267.       LOGICAL PROTCT
  268.  
  269. --- 18,24 -----
  270.   C
  271.   C DECLARATIONS
  272.   C
  273. !     LOGICAL FUNCTION DINIT(X)
  274.       IMPLICIT INTEGER (A-Z)
  275.   #ifndef PDP
  276.       LOGICAL PROTCT
  277. ***************
  278. *** 153,159
  279.       FROMDR=0
  280.       SCOLRM=0
  281.       SCOLAC=0
  282. !     INIT=.FALSE.        
  283.       MLOC=MRB
  284.   C
  285.   C INIT, PAGE 4
  286.  
  287. --- 153,159 -----
  288.       FROMDR=0
  289.       SCOLRM=0
  290.       SCOLAC=0
  291. !     DINIT=.FALSE.        
  292.       MLOC=MRB
  293.   C
  294.   C INIT, PAGE 4
  295. ***************
  296. *** 247,253
  297.       HERE=AROOM(WINNER)
  298.       THFPOS=OROOM(THIEF)
  299.       BLOC=OROOM(BALLO)
  300. !     INIT=.TRUE.
  301.   #ifdef debug
  302.   C
  303.   C    Normally, PRSFLG is setable in gdt to allow seeing various
  304.  
  305. --- 247,253 -----
  306.       HERE=AROOM(WINNER)
  307.       THFPOS=OROOM(THIEF)
  308.       BLOC=OROOM(BALLO)
  309. !     DINIT=.TRUE.
  310.   #ifdef debug
  311.   C
  312.   C    Normally, PRSFLG is setable in gdt to allow seeing various
  313. ***************
  314. *** 266,272
  315.   1925    continue
  316.       END
  317.   #else PDP
  318. ! 10000    INIT=.FALSE.
  319.   C                        !ASSUME INIT FAILS.
  320.       MMAX=1050
  321.   C                        !SET UP ARRAY LIMITS.
  322.  
  323. --- 266,272 -----
  324.   1925    continue
  325.       END
  326.   #else PDP
  327. ! 10000    DINIT=.FALSE.
  328.   C                        !ASSUME INIT FAILS.
  329.       MMAX=1050
  330.   C                        !SET UP ARRAY LIMITS.
  331. ***************
  332. *** 449,455
  333.   C
  334.   C NOW RESTORE FROM EXISTING INDEX FILE.
  335.   C
  336. !     OPEN(UNIT=1,file=INDXFILE,status='OLD',
  337.   #ifdef XELOS
  338.   &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
  339.   #else
  340.  
  341. --- 449,455 -----
  342.   C
  343.   C NOW RESTORE FROM EXISTING INDEX FILE.
  344.   C
  345. !     OPEN(UNIT=3,file=INDXFILE,status='OLD',
  346.   #ifdef XELOS
  347.   &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
  348.   #else
  349. ***************
  350. *** 455,462
  351.   #else
  352.   &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
  353.   #endif
  354. !     rewind(unit=1, err=1900)
  355. !     READ(1,130) I,J,K
  356.   C                        !GET VERSION.
  357.       IF((I.NE.VMAJ).OR.(J.NE.VMIN))
  358.   &        GO TO 1925
  359.  
  360. --- 455,462 -----
  361.   #else
  362.   &        FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
  363.   #endif
  364. !     rewind(unit=3, err=1900)
  365. !     READ(3,130) I,J,K
  366.   C                        !GET VERSION.
  367.       IF((I.NE.VMAJ).OR.(J.NE.VMIN))
  368.   &        GO TO 1925
  369. ***************
  370. *** 474,483
  371.   150    FORMAT(' RESTORING FROM "dindx.dat"')
  372.   #endif NOCC
  373.   #endif debug
  374. !     READ(1,130) MXSCOR,STRBIT,EGMXSC
  375. !     READ(1,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
  376. !     READ(1,130) XLNT,TRAVEL
  377. !     READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  378.   &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  379.   &        OREAD
  380.       READ(1,130) R2LNT,OROOM2,RROOM2
  381.  
  382. --- 474,483 -----
  383.   150    FORMAT(' RESTORING FROM "dindx.dat"')
  384.   #endif NOCC
  385.   #endif debug
  386. !     READ(3,130) MXSCOR,STRBIT,EGMXSC
  387. !     READ(3,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
  388. !     READ(3,130) XLNT,TRAVEL
  389. !     READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  390.   &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  391.   &        OREAD
  392.       READ(3,130) R2LNT,OROOM2,RROOM2
  393. ***************
  394. *** 480,491
  395.       READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  396.   &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  397.   &        OREAD
  398. !     READ(1,130) R2LNT,OROOM2,RROOM2
  399. !     READ(1,130) CLNT,CTICK,CACTIO
  400. !     READ(1,135) CFLAG
  401. !     READ(1,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
  402. !     READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  403. !     READ(1,130) MBASE,MLNT,RTEXT
  404.   C
  405.       CLOSE(1)
  406.       GO TO 1025
  407.  
  408. --- 480,491 -----
  409.       READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
  410.   &        OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
  411.   &        OREAD
  412. !     READ(3,130) R2LNT,OROOM2,RROOM2
  413. !     READ(3,130) CLNT,CTICK,CACTIO
  414. !     READ(3,135) CFLAG
  415. !     READ(3,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
  416. !     READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  417. !     READ(3,130) MBASE,MLNT,RTEXT
  418.   C
  419.   C    don't CLOSE index file, even though it won't be used again
  420.   C
  421. ***************
  422. *** 487,493
  423.       READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  424.       READ(1,130) MBASE,MLNT,RTEXT
  425.   C
  426. !     CLOSE(1)
  427.       GO TO 1025
  428.   C                        !INIT DONE.
  429.   C
  430.  
  431. --- 487,494 -----
  432.       READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
  433.       READ(3,130) MBASE,MLNT,RTEXT
  434.   C
  435. ! C    don't CLOSE index file, even though it won't be used again
  436. ! C
  437.       GO TO 1025
  438.   C                        !INIT DONE.
  439.   C
  440. ***************
  441. *** 511,517
  442.       HERE=AROOM(WINNER)
  443.       THFPOS=OROOM(THIEF)
  444.       BLOC=OROOM(BALLO)
  445. !     INIT=.TRUE.
  446.   C
  447.   #ifdef debug
  448.       PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
  449.  
  450. --- 512,518 -----
  451.       HERE=AROOM(WINNER)
  452.       THFPOS=OROOM(THIEF)
  453.       BLOC=OROOM(BALLO)
  454. !     DINIT=.TRUE.
  455.   C
  456.   #ifdef debug
  457.       PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
  458. *** dmain.F.orig    Mon Oct 24 15:28:56 1988
  459. --- dmain.F    Mon Oct 24 15:28:55 1988
  460. ***************
  461. *** 9,15
  462.   C DECLARATIONS
  463.   C
  464.       IMPLICIT INTEGER (A-Z)
  465. !     LOGICAL INIT
  466.   #include "parser.h"
  467.   #include "gamestate.h"
  468.   #include "state.h"
  469.  
  470. --- 9,15 -----
  471.   C DECLARATIONS
  472.   C
  473.       IMPLICIT INTEGER (A-Z)
  474. !     LOGICAL DINIT
  475.   #include "parser.h"
  476.   #include "gamestate.h"
  477.   #include "state.h"
  478. ***************
  479. *** 193,199
  480.   C 1) INITIALIZE DATA STRUCTURES
  481.   C 2) PLAY GAME
  482.   C
  483. !     IF(INIT(X)) CALL GAME
  484.   C                        !IF INIT, PLAY GAME.
  485.       CALL EXIT
  486.   C                        !DONE
  487.  
  488. --- 193,199 -----
  489.   C 1) INITIALIZE DATA STRUCTURES
  490.   C 2) PLAY GAME
  491.   C
  492. !     IF(DINIT(X)) CALL GAME
  493.   C                        !IF INIT, PLAY GAME.
  494.       CALL EXIT
  495.   C                        !DONE
  496. *** dso3.F.orig    Mon Oct 24 15:28:56 1988
  497. --- dso3.F    Mon Oct 24 15:28:56 1988
  498. ***************
  499. *** 64,70
  500.   C OBJECT IS ON LIST... IS IT A MATCH?
  501.   C
  502.         IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
  503. !       IF(and(not(NOCARE),(and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
  504.   &        ((and(OFLAG1(I),F1).EQ.0).AND.
  505.   &         (and(OFLAG2(I),F2).EQ.0))) GO TO 500
  506.         IF(FWIM.EQ.0) GO TO 400
  507.  
  508. --- 64,70 -----
  509.   C OBJECT IS ON LIST... IS IT A MATCH?
  510.   C
  511.         IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
  512. !       IF( ((.NOT. NOCARE) .AND. (and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
  513.   &        ((and(OFLAG1(I),F1).EQ.0).AND.
  514.   &         (and(OFLAG2(I),F2).EQ.0))) GO TO 500
  515.         IF(FWIM.EQ.0) GO TO 400
  516. *** dso7.F.orig    Mon Oct 24 15:28:56 1988
  517. --- dso7.F    Mon Oct 24 15:28:56 1988
  518. ***************
  519. *** 23,29
  520.   C                        !UNBIAS, COMPUTE SUMS.
  521.         UKEYW(I)=char(ichar(KEYW(I))-64)
  522.         IF(INW(J).LE.char(64)) J=1
  523. !       UINW(I)=ichar(ichar(INW(J))-64)
  524.         UKEYWS=UKEYWS+ichar(UKEYW(I))
  525.         UINWS=UINWS+UINW(I)
  526.         J=J+1
  527.  
  528. --- 23,29 -----
  529.   C                        !UNBIAS, COMPUTE SUMS.
  530.         UKEYW(I)=char(ichar(KEYW(I))-64)
  531.         IF(INW(J).LE.char(64)) J=1
  532. !       UINW(I)=ichar(INW(J))-64
  533.         UKEYWS=UKEYWS+ichar(UKEYW(I))
  534.         UINWS=UINWS+UINW(I)
  535.         J=J+1
  536. ***************
  537. *** 32,38
  538.       USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
  539.   C                        !COMPUTE MASK.
  540.       DO 200 I=1,6
  541. !       J=and(xor(xor(ichar(UINW(I)),ichar(UKEYW(I))),USUM),31)
  542.         USUM=MOD(USUM+1,32)
  543.         IF(J.GT.26) J=MOD(J,26)
  544.         OUTW(I)=char(MAX0(1,J)+64)
  545.  
  546. --- 32,38 -----
  547.       USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
  548.   C                        !COMPUTE MASK.
  549.       DO 200 I=1,6
  550. !       J=and(xor(xor(UINW(I),ichar(UKEYW(I))),USUM),31)
  551.         USUM=MOD(USUM+1,32)
  552.         IF(J.GT.26) J=MOD(J,26)
  553.         OUTW(I)=char(MAX0(1,J)+64)
  554. *** dsub.F.orig    Mon Oct 24 15:28:57 1988
  555. --- dsub.F    Mon Oct 24 15:28:56 1988
  556. ***************
  557. *** 391,401
  558.   C                        !INVOLUNTARY EXIT.
  559.   1100    CALL SCORE(.FALSE.)
  560.   C                        !TELL SCORE.
  561. ! #ifdef PDP
  562. ! C    file closed in exit routine
  563. ! #else
  564. !     CLOSE(DBCH)
  565. ! #endif PDP
  566.       CALL EXIT
  567.   C
  568.       END
  569.  
  570. --- 391,397 -----
  571.   C                        !INVOLUNTARY EXIT.
  572.   1100    CALL SCORE(.FALSE.)
  573.   C                        !TELL SCORE.
  574. ! C    don't close DBCH, just exit
  575.       CALL EXIT
  576.   C
  577.       END
  578. *** dverb2.F.orig    Mon Oct 24 15:28:57 1988
  579. --- dverb2.F    Mon Oct 24 15:28:57 1988
  580. ***************
  581. *** 91,99
  582.   &        SWDACT,SWDSTA,CPVEC
  583.       WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  584.   &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  585. !     WRITE(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
  586. ! &        OSIZE,OCAPAC,OROOM,OADV,OCAN
  587. !     WRITE(1) RVAL,RFLAG
  588.       WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  589.       WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  590.   C
  591.  
  592. --- 91,109 -----
  593.   &        SWDACT,SWDSTA,CPVEC
  594.       WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  595.   &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  596. !     WRITE(1) ODESC1
  597. !     WRITE(1) ODESC2
  598. !     WRITE(1) OFLAG1
  599. !     WRITE(1) OFLAG2
  600. !     WRITE(1) OFVAL
  601. !     WRITE(1) OTVAL
  602. !     WRITE(1) OSIZE
  603. !     WRITE(1) OCAPAC
  604. !     WRITE(1) OROOM
  605. !     WRITE(1) OADV
  606. !     WRITE(1) OCAN
  607. !     WRITE(1) RVAL
  608. !     WRITE(1) RFLAG
  609.       WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  610.       WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  611.   C
  612. ***************
  613. *** 195,201
  614.       rewind (unit=1, err=100)
  615.   C
  616.       READ(1) I,J,K
  617. !     IF(or((I.NE.VMAJ),(J.NE.VMIN))) GO TO 200
  618.   C
  619.       READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
  620.   &        SWDACT,SWDSTA,CPVEC
  621.  
  622. --- 205,211 -----
  623.       rewind (unit=1, err=100)
  624.   C
  625.       READ(1) I,J,K
  626. !     IF(((I.NE.VMAJ) .OR. (J.NE.VMIN))) GO TO 200
  627.   C
  628.       READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
  629.   &        SWDACT,SWDSTA,CPVEC
  630. ***************
  631. *** 201,209
  632.   &        SWDACT,SWDSTA,CPVEC
  633.       READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  634.   &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  635. !     READ(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
  636. ! &        OSIZE,OCAPAC,OROOM,OADV,OCAN
  637. !     READ(1) RVAL,RFLAG
  638.       READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  639.       READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  640.   C
  641.  
  642. --- 211,229 -----
  643.   &        SWDACT,SWDSTA,CPVEC
  644.       READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
  645.   &        LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
  646. !     READ(1) ODESC1
  647. !     READ(1) ODESC2
  648. !     READ(1) OFLAG1
  649. !     READ(1) OFLAG2
  650. !     READ(1) OFVAL
  651. !     READ(1) OTVAL
  652. !     READ(1) OSIZE
  653. !     READ(1) OCAPAC
  654. !     READ(1) OROOM
  655. !     READ(1) OADV
  656. !     READ(1) OCAN
  657. !     READ(1) RVAL
  658. !     READ(1) RFLAG
  659.       READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
  660.       READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
  661.   C
  662. ***************
  663. *** 421,427
  664.   C
  665.   C C7-    FROBOZZ FLAG (BANK ALARM)
  666.   C
  667. ! 7000    FROBZF=and((OROOM(BILLS).NE.0),(OROOM(PORTR).NE.0))
  668.       RETURN
  669.   C CXAPPL, PAGE 3
  670.   C
  671.  
  672. --- 441,447 -----
  673.   C
  674.   C C7-    FROBOZZ FLAG (BANK ALARM)
  675.   C
  676. ! 7000    FROBZF=((OROOM(BILLS).NE.0) .AND. (OROOM(PORTR).NE.0))
  677.       RETURN
  678.   C CXAPPL, PAGE 3
  679.   C
  680. *** exit.c.orig    Mon Oct 24 15:28:57 1988
  681. --- exit.c    Mon Oct 24 15:28:57 1988
  682. ***************
  683. *** 0
  684.  
  685. --- 1 -----
  686. + void exit_() { exit(0); }
  687. *** gdt.F.orig    Mon Oct 24 15:28:58 1988
  688. --- gdt.F    Mon Oct 24 15:28:58 1988
  689. ***************
  690. *** 102,108
  691.       GO TO 2000
  692.   C
  693.   #ifdef NOCC
  694. ! 200    FORMAT('GDT>',$)
  695.   #else NOCC
  696.   200    FORMAT(' GDT>',$)
  697.   #endif NOCC
  698.  
  699. --- 102,108 -----
  700.       GO TO 2000
  701.   C
  702.   #ifdef NOCC
  703. ! 200    FORMAT('GDT>')
  704.   #else NOCC
  705.   200    FORMAT(' GDT>',$)
  706.   #endif NOCC
  707. ***************
  708. *** 115,123
  709.   230    FORMAT(2I6)
  710.   240    FORMAT(I6)
  711.   #ifdef NOCC
  712. ! 225    FORMAT('Limits:   ',$)
  713. ! 235    FORMAT('Entry:    ',$)
  714. ! 245    FORMAT('Idx,Ary:  ',$)
  715.   #else NOCC
  716.   225    FORMAT(' Limits:   ',$)
  717.   235    FORMAT(' Entry:    ',$)
  718.  
  719. --- 115,123 -----
  720.   230    FORMAT(2I6)
  721.   240    FORMAT(I6)
  722.   #ifdef NOCC
  723. ! 225    FORMAT('Limits:   ')
  724. ! 235    FORMAT('Entry:    ')
  725. ! 245    FORMAT('Idx,Ary:  ')
  726.   #else NOCC
  727.   225    FORMAT(' Limits:   ',$)
  728.   235    FORMAT(' Entry:    ',$)
  729. ***************
  730. *** 344,350
  731.       GO TO 2000
  732.   C
  733.   #ifdef NOCC
  734. ! 480    FORMAT('Old=',L2,6X,'New= ',$)
  735.   #else NOCC
  736.   480    FORMAT(' Old=',L2,6X,'New= ',$)
  737.   #endif NOCC
  738.  
  739. --- 344,350 -----
  740.       GO TO 2000
  741.   C
  742.   #ifdef NOCC
  743. ! 480    FORMAT('Old=',L2,6X,'New= ')
  744.   #else NOCC
  745.   480    FORMAT(' Old=',L2,6X,'New= ',$)
  746.   #endif NOCC
  747. ***************
  748. *** 528,534
  749.       GO TO 2000
  750.   C
  751.   #ifdef NOCC
  752. ! 590    FORMAT('Old= ',I6,6X,'New= ',$)
  753.   #else NOCC
  754.   590    FORMAT(' Old= ',I6,6X,'New= ',$)
  755.   #endif NOCC
  756.  
  757. --- 528,534 -----
  758.       GO TO 2000
  759.   C
  760.   #ifdef NOCC
  761. ! 590    FORMAT('Old= ',I6,6X,'New= ')
  762.   #else NOCC
  763.   590    FORMAT(' Old= ',I6,6X,'New= ',$)
  764.   #endif NOCC
  765. ***************
  766. *** 574,580
  767.       GO TO 2000
  768.   C
  769.   #ifdef NOCC
  770. ! 610    FORMAT('Old= ',I6,6X,'New= ',$)
  771.   #else NOCC
  772.   610    FORMAT(' Old= ',I6,6X,'New= ',$)
  773.   #endif NOCC
  774.  
  775. --- 574,580 -----
  776.       GO TO 2000
  777.   C
  778.   #ifdef NOCC
  779. ! 610    FORMAT('Old= ',I6,6X,'New= ')
  780.   #else NOCC
  781.   610    FORMAT(' Old= ',I6,6X,'New= ',$)
  782.   #endif NOCC
  783. *** np.F.orig    Mon Oct 24 15:28:58 1988
  784. --- np.F    Mon Oct 24 15:28:58 1988
  785. ***************
  786. *** 25,31
  787.   10    WRITE(OUTCH,50)
  788.   C                        !PROMPT FOR GAME.
  789.   #ifdef NOCC
  790. ! 50    FORMAT('>',$)
  791.   #else NOCC
  792.   50    FORMAT(' >',$)
  793.   #endif NOCC
  794.  
  795. --- 25,31 -----
  796.   10    WRITE(OUTCH,50)
  797.   C                        !PROMPT FOR GAME.
  798.   #ifdef NOCC
  799. ! 50    FORMAT('>')
  800.   #else NOCC
  801.   50    FORMAT(' >',$)
  802.   #endif NOCC
  803. ***************
  804. *** 30,36
  805.   50    FORMAT(' >',$)
  806.   #endif NOCC
  807.   
  808. ! 90    READ(INPCH,100, END=210) BUFFER
  809.   100    FORMAT(78A1)
  810.   
  811.       DO 200 LENGTH=78,1,-1
  812.  
  813. --- 30,36 -----
  814.   50    FORMAT(' >',$)
  815.   #endif NOCC
  816.   
  817. ! 90    READ(INPCH,100,END=210) (BUFFER(LENGTH),LENGTH=1,78)
  818.   100    FORMAT(78A1)
  819.   
  820.       DO 200 LENGTH=78,1,-1
  821. ***************
  822. *** 38,44
  823.   200    CONTINUE
  824.       GO TO 5
  825.   C                        !END OF FILE
  826. ! 210    STOP
  827.   C                        !TRY AGAIN.
  828.   
  829.   C
  830.  
  831. --- 38,44 -----
  832.   200    CONTINUE
  833.       GO TO 5
  834.   C                        !END OF FILE
  835. ! 210    CALL EXIT
  836.   C                        !TRY AGAIN.
  837.   
  838.   C
  839. ***************
  840. *** 55,61
  841.   
  842.   C CONVERT TO UPPER CASE
  843.   300    DO 400 I=1,LENGTH
  844. !        IF(and((BUFFER(I).GE.'a'),(BUFFER(I).LE.'z')))
  845.   &        BUFFER(I)=char(ichar(BUFFER(I))-32)
  846.   400    CONTINUE
  847.   #endif PDP
  848.  
  849. --- 55,61 -----
  850.   
  851.   C CONVERT TO UPPER CASE
  852.   300    DO 400 I=1,LENGTH
  853. !        IF(((BUFFER(I).GE.'a') .AND. (BUFFER(I).LE.'z')))
  854.   &        BUFFER(I)=char(ichar(BUFFER(I))-32)
  855.   400    CONTINUE
  856.   #endif PDP
  857. ***************
  858. *** 105,111
  859.   C                        !ECHO MODE, FORCE FAIL.
  860.       IF(.NOT.SYNMCH(X)) GO TO 100
  861.   C                        !DO SYN MATCH.
  862. !     IF(and((PRSO.GT.0),(PRSO.LT.XMIN))) LASTIT=PRSO
  863.   C
  864.   C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
  865.   C
  866.  
  867. --- 105,111 -----
  868.   C                        !ECHO MODE, FORCE FAIL.
  869.       IF(.NOT.SYNMCH(X)) GO TO 100
  870.   C                        !DO SYN MATCH.
  871. !     IF(((PRSO.GT.0) .AND. (PRSO.LT.XMIN))) LASTIT=PRSO
  872.   C
  873.   C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
  874.   C
  875. ***************
  876. *** 207,213
  877.   C                        !SPACE?
  878.       DO 500 I=1,9,3
  879.   C                        !SCH FOR CHAR.
  880. !       IF(and((J.GE.DLIMIT(I)),(J.LE.DLIMIT(I+1))))
  881.   &        GO TO 4000
  882.   500    CONTINUE
  883.   C
  884.  
  885. --- 207,213 -----
  886.   C                        !SPACE?
  887.       DO 500 I=1,9,3
  888.   C                        !SCH FOR CHAR.
  889. !       IF(((J.GE.DLIMIT(I)) .AND. (J.LE.DLIMIT(I+1))))
  890.   &        GO TO 4000
  891.   500    CONTINUE
  892.   C
  893. ***************
  894. *** 219,225
  895.   C
  896.   1000    IF(PRSCON.GT.INLNT) PRSCON=1
  897.   C                        !FORCE PARSE RESTART.
  898. !     IF(and((CP.EQ.0),(OP.EQ.1))) RETURN
  899.       IF(CP.EQ.0) OP=OP-2
  900.   C                        !ANY LAST WORD?
  901.       LEX=.TRUE.
  902.  
  903. --- 219,225 -----
  904.   C
  905.   1000    IF(PRSCON.GT.INLNT) PRSCON=1
  906.   C                        !FORCE PARSE RESTART.
  907. !     IF(((CP.EQ.0) .AND. (OP.EQ.1))) RETURN
  908.       IF(CP.EQ.0) OP=OP-2
  909.   C                        !ANY LAST WORD?
  910.       LEX=.TRUE.
  911. *** sverbs.F.orig    Mon Oct 24 15:28:59 1988
  912. --- sverbs.F    Mon Oct 24 15:28:58 1988
  913. ***************
  914. *** 293,303
  915.   C                        !TELLL SCORE.
  916.       IF(.NOT.YESNO(343,0,0)) RETURN
  917.   C                        !ASK FOR Y/N DECISION.
  918. ! #ifdef PDP
  919. ! C    close routine moved to exit for pdp version
  920. ! #else
  921. !     CLOSE (DBCH)
  922. ! #endif PDP
  923.       CALL EXIT
  924.   C                        !BYE.
  925.   C SVERBS, PAGE 4
  926.  
  927. --- 293,299 -----
  928.   C                        !TELLL SCORE.
  929.       IF(.NOT.YESNO(343,0,0)) RETURN
  930.   C                        !ASK FOR Y/N DECISION.
  931. ! C    don't close DBCH, just exit
  932.       CALL EXIT
  933.   C                        !BYE.
  934.   C SVERBS, PAGE 4
  935.  
  936.  
  937.